home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / tool_inc.zip / FILESIZE.INC < prev    next >
Text File  |  1989-06-02  |  796b  |  33 lines

  1.  
  2. (*
  3.  * Copyright 1987, 1989 Samuel H. Smith;  All rights reserved
  4.  *
  5.  * This is a component of the ProDoor System.
  6.  * Do not distribute modified versions without my permission.
  7.  * Do not remove or alter this notice or any other copyright notice.
  8.  * If you use this in your own program you must distribute source code.
  9.  * Do not use any of this in a commercial product.
  10.  *
  11.  *)
  12.  
  13. (*
  14.  * filesize.inc - utility library to return the size of a file in bytes.
  15.  *                returns 0 if the file does not exist
  16.  *
  17.  * shs 14-feb-86, (rev. 21-Dec-87)
  18.  *
  19.  *)
  20.  
  21. function file_size(name: string65): longint;
  22. var
  23.    DirInfo:     SearchRec;
  24.  
  25. begin
  26.    FindFirst(name,$21,DirInfo);
  27.    if (DosError <> 0) then
  28.       file_size := 0
  29.    else
  30.       file_size := DirInfo.size;
  31. end;
  32.  
  33.